import { INCREMENT, DECREMENT } from "../constant";
const initCount = 0;
export default (preState = initCount, action) => {
  const { type, data } = action;
  switch (type) {
    case INCREMENT:
      return preState + data * 1;
    case DECREMENT:
      return preState - data * 1;
    default:
      return preState;
  }
};
